extends Node2D

const SPEED = 60

var direction = 1

@onready var ray_cast_right = $KillZone/RayCastRight
@onready var ray_cast_left = $KillZone/RayCastLeft
@onready var animated_sprite_2d = $AnimatedSprite2D

func _process(delta):
    if ray_cast_right.is_colliding():
        direction = -1
        animated_sprite_2d.flip_h = true
    if ray_cast_left.is_colliding():
        direction = 1
        animated_sprite_2d.flip_h = false

    # if direction == 1:
    #     animated_sprite_2d.flip_h = true
    # else :
    #     animated_sprite_2d.flip_h = false
    var _a = direction * SPEED * delta
